package com.code.day10;

public class Test03 {
    public static void main(String[] args) {
        //Dog特有功能
        Dog dog = new Dog();
        dog.eat();
        dog.lookHome();
        //Cat特有功能
        Cat cat = new Cat();
        cat.eat();
        cat.catchMouse();

        method(dog);

    }

    public static void method(Animal animal) {
        animal.eat();
        Dog dog = (Dog)animal;
        dog.lookHome();
        dog.eat();
        animal.eat();
        ((Dog) animal).lookHome();
    }
}
